﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinformToolkit.Navigations;

namespace WinformToolkitDemo.UserControls
{
    public partial class MatrixUserControl : UserControl, IContentControl
    {
        private float angle;
        private RectangleF rect;

        public MatrixUserControl()
        {
            InitializeComponent();
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            Matrix matrix = new Matrix();
            matrix.RotateAt(this.angle++, new PointF());

            //System.Windows.Rect rect = rotateTransform.TransformBounds(new System.Windows.Rect(this.rect.X, this.rect.Y, this.rect.Width, this.rect.Height));
            //this.center = new PointF((float)p.X, (float)p.Y);
            //e.Graphics.DrawEllipse(new System.Drawing.Pen(System.Drawing.Brushes.Black), this.center.X, this.center.Y, 10, 10);

            //Console.WriteLine("x = {0}, y = {1}", this.center.X, this.center.Y);
        }

        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);

            if (e.KeyCode == Keys.Enter)
            {
                this.Invalidate();
            }
        }
    }
}
